<h1>Campaign Details</h1>
<?php
    $this->headTitle('View Campaign');
    $this->headScript()->appendFile('/js/BizSense/Crud.js'); 
    $campaign = $this->campaign;
    $campaignId = $this->escape($this->campaignId);
    $acl = $this->acl;    
?>

<?php 
if ($acl->isAllowed($this->currentUser, 'access campaign pages')):
echo "<a href=\"" . $this->url(
            array(
                'module' => 'default', 
                'controller' => 'campaign', 
                'action' => 'index'
            ), NULL, true
        ) . "\">Campaign</a> | ";
endif;

if ($acl->isAllowed($this->currentUser, 'edit campaigns')):
echo "<a href=\"" . $this->url(
            array(
                'module' => 'default', 
                'controller' => 'campaign', 
                'action' => 'edit',
                'campaign_id' => $campaignId
            ), NULL, true
        ) . "\">Edit</a> | ";
endif;        

if ($acl->isAllowed($this->currentUser, 'delete campaigns')):
    $deleteUrl = $this->url(
                    array(
                        'module' => 'default',
                        'controller' => 'campaign',
                        'action' => 'delete',
                        'campaign_id' =>$this->escape($campaignId)
                    )
                );
                echo $this->deleteButton($deleteUrl); 
 endif; ?>
|


<table class="data_table">
    <tr>
        <td>Name </td> 
        <td><?php echo $this->escape($campaign['name']); ?></td>
    </tr>
    <tr>
        <td>Description </td> 
        <td><?php echo $this->escape($campaign['description']); ?></td>
    </tr>
    <tr>
        <td>Start Date </td>
        <td><?php echo $this->escape($this->timestampToDocument(
                            $this->escape($campaign['start_date']))); ?>
        </td>
    </tr>
    <tr>
        <td>End Date </td> 
        <td>
            <?php echo $this->escape($this->timestampToDocument(
                    $this->escape($campaign['end_date']
                ))); ?>
        </td>
    </tr>
    <tr>
        <td>Assigned To </td>
        <td><?php echo $this->escape($campaign['assigned_name']); ?></td>
    </tr>
    <tr>
        <td>Branch </td>
        <td><?php echo $this->escape($campaign['branch_name']); ?></td>
    </tr>
</table>

<h3>Campaign summary </h3>
<table class="data_table">
    <tr> 
        <td>Number of leads created from this campaign</td>
        <td><?php $totalLeads = $this->totalLeads;
                echo $this->escape($totalLeads); ?>
        </td>
    </tr>
    <tr>
        <td> Number of opportunities created from this campaign
        </td>
        <td><?php $totalOpportunities = $this->totalOpportunities;
            echo $this->escape($totalOpportunities); ?>
        </td>
    </tr>
    <tr>
        <td> Number of contacts created from this campaign
        </td>
        <td><?php $totalContacts = $this->totalContacts;
            echo $this->escape($totalContacts); ?>
        </td>
    </tr>
    <tr>
        <td> Number of accounts created from this campaign
        </td>
        <td><?php $totalAccounts = $this->totalAccounts;
            echo $this->escape($totalAccounts); ?>
        </td>
    </tr>
    <tr>
        <td> Number of invoices created from this campaign
        </td>
        <td><?php $totalInvoices = $this->totalInvoices;
            echo $this->escape($totalInvoices); ?>
        </td>
    </tr>
    <tr>
        <td> Number of quotes created from this campaign
        </td>
        <td><?php $totalQuotes = $this->totalQuotes;
            echo $this->escape($totalQuotes); ?>
        </td>
    </tr>
    <tr>
        <td> Number of messages created from this campaign
        </td>
        <td><?php $totalMessages = $this->totalMessages;
            echo $this->escape($totalMessages); ?>
        </td>
    </tr>

</table>
